import { createRouter, createWebHistory } from 'vue-router'


const staticRoutes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        component: () => import('@/views/home/HomeIndex.vue'),
    },
    {
        path: '/admin',
        name: '管理后台',
        component: () => import('@/views/admin/Index.vue'),
        redirect: '/defaultContent',
        children: [
            {
                path: '/defaultContent',
                name: '后台首页',
                component: () => import('@/views/modules/UserDefaultContent/List.vue')
            },
            {
                path: '/myDetail',
                name: '个人详细信息',
                component: () => import('@/views/modules/myDetail/List.vue')
            },
            {
                path: '/updatePassword',
                name: '修改密码',
                component: () => import('@/views/modules/resetPassword/List.vue')
            },
            {
                path: '/userManegement',
                name: '用户管理',
                component: () => import('@/views/modules/user/List.vue')
            },
            {
                path: '/roomManagement',
                name: '房间管理',
                component: () => import('@/views/modules/home/List.vue')
            },
            {
                path: '/roomTypeManagement',
                name: '房间类型管理',
                component: () => import('@/views/modules/homeType/List.vue')
            },
            {
                path: '/homeOrderManagement',
                name: '房间订单管理',
                component: () => import('@/views/modules/homeOrder/List.vue')
            },
            {
                path: '/authorityManagement',
                name: '权限管理',
                component: () => import('@/views/modules/authority/List.vue')
            },
            {
                path: '/financeManagement',
                name: '财务管理',
                component: () => import('@/views/modules/finance/List.vue')
            },
        ]
    },
    { path: '/login', name: 'login', component: () => import('@/views/Login.vue') },
    { path: '/register', name: 'register', component: () => import('@/views/Register.vue') },
    { path: '/:pathMatch(.*)', name: 'error404', component: () => import('@/views/Error404.vue') }
]

export default createRouter({
    history: createWebHistory(),
    routes: staticRoutes
})


